class PressBPN implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            try {
                String text = tf.getText();
                if (text != "") {
                    if(text.charAt(0) == '-')
                        tf.setText(text.substring(1));
                    else if(text.charAt(0) >= '0' && text.charAt(0)<='9')
                        tf.setText("-"+text.substring(0));
                    else if(text.charAt(0) == '.')
                        tf.setText("-0"+text.substring(0));
                }
            } catch(Exception ee) {}
        }
    }
    class PressBAbs implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            try {
                double x = Double.parseDouble(tf.getText());
                double y;
                y = Math.abs(x);
                tf.setText(y+"");
            } catch(Exception ee) {}
        }
    }
    class PressBPoint implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            String text = tf.getText();
            if(text.lastIndexOf(".") == -1)
                tf.setText(text+".");
        }
    }
    class PressB0 implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            String text = tf.getText();
            tf.setText(text+"0");
        }
    }
    class PressB1 implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            String text = tf.getText();
            tf.setText(text+"1");
        }
    }
    class PressB2 implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            String text = tf.getText();
            tf.setText(text+"2");
        }
    }
    class PressB3 implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            String text = tf.getText();
            tf.setText(text+"3");
        }
    }
    class PressB4 implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            String text = tf.getText();
            tf.setText(text+"4");
        }
    }
    class PressB5 implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            String text = tf.getText();
            tf.setText(text+"5");
        }
    }
    class PressB6 implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            String text = tf.getText();
            tf.setText(text+"6");
        }
    }
    class PressB7 implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            String text = tf.getText();
            tf.setText(text+"7");
        }
    }
    class PressB8 implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            String text = tf.getText();
            tf.setText(text+"8");
        }
    }
    class PressB9 implements  ActionListener {
        public void actionPerformed(ActionEvent e) {
            String text = tf.getText();
            tf.setText(text+"9");
        }
    }